package wk.coral.core;

import org.apache.commons.lang3.StringUtils;
import wk.coral.core.enums.RunEnum;
import wk.coral.entity.config.PropertiesConfigEntity;

/**
 * description:
 * date 2021-01-16 17:35
 *
 * @author Administrator
 * @version 1.0
 */
public class RunJar {

    private RunJar(){}

    private static volatile RunJar instance;

    public static RunJar getInstance(){
        if (instance == null) {
            synchronized (RunJar.class){
                if (instance == null) {
                    instance = new RunJar();
                }
            }
        }
        return instance;
    }

    public void run(PropertiesConfigEntity propertiesConfigEntity){
        String type = propertiesConfigEntity.getType();
        RunEnum.valueOf(type.toUpperCase()).run(propertiesConfigEntity);
    }
}
